/*
 * @Author: taoyuqing
 * @Date: 2022-12-31 18:49:06
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:spree/utils/utils.dart';

class VipRectangleBox extends StatelessWidget {
  final Widget? child;
  final double? width;
  final double? height;
  final EdgeInsets? padding;
  final EdgeInsets? margin;
  final Alignment? alignment;
  final Function? onTap;
  final Color? color;
  VipRectangleBox(
      {Key? key,
      this.child,
      this.width,
      this.height,
      this.padding,
      this.margin,
      this.alignment,
      this.onTap,
      this.color})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        if (onTap != null) {
          onTap!();
        }
      },
      child: Container(
        alignment: alignment,
        width: width,
        height: height,
        margin: margin,
        padding: padding ?? EdgeInsets.only(left: 15, right: 15),
        decoration: BoxDecoration(
          color: color??Utils().createMaterialColor(),
          borderRadius: const BorderRadius.all(Radius.circular(8.0)),
        ),
        child: child,
      ),
    );
  }
}
